<tal:block tal:repeat="users  getAlbum/result">
<?php 
if(isset($ctx->users['AlbumRelations'][0]['MyFavorites']['status']))
{
$favorite_status = $ctx->users['AlbumRelations'][0]['MyFavorites']['status'];
}
else {
			$favorite_status = '';
	}	
?>
<div class="PhoVid">
<?php if($ctx->users['AlbumRelations'][0]['read_status'] == 0) { $class="act"; } else { $class="nor"; } ?>
<div class="<?php echo $class;?>">
<div class="blkCont">
<?php if(isset($ctx->users['photo'])) { ?>
<div class="Icon"><img src="/images/PhotoIconUser.png" /></div>
<? } else { ?>
<div class="Icon"><img src="/images/PhotoIconUser.png" /></div>
<? } ?>
<p class="UserImg">
<img src="/images/AlbumImg.jpg" alt="Album" title="Album" /></p>
<p class="Date"><?php echo ago(strtotime($ctx->users['added_date']));?></p>
</div>
<div class="blkCont">
<div class="wid240">
<p class="Title"><a href="/album/index/album-view/<?php echo base64_encode($ctx->type).'/'.base64_encode($ctx->users['album_id']); ?>"><?php echo $ctx->users['title'];?></a></p>
<p class="Desc"><span tal:content="structure php: this.SubStrText(users['description'], 30)">Des Here</span> </p>
<span><a href="#" class="UserShare">Share</a></span><span><a href="#" class="CaleLink">Event</a></span>
</div>
</div>
<div class="blkContRt">
<?php if($favorite_status=="Active"){?>
<a href="javascript:void(0);" onclick="changeStatusFavorite(<?php echo $ctx->users['album_id'];?>,'Inactive')"><img src="/images/FavorIconAct.png" alt="Favorite" title="Favorite" /></a>
<? } else {?>
<a href="javascript:void(0);" onclick="changeStatusFavorite(<?php echo $ctx->users['album_id'];?>,'Active')"><img src="/images/FavorIconNor.png" alt="Favorite" title="Favorite" /></a>
<? } ?>
<span><a href="javascript:void(0);" onclick="changeStatustoClose(<?php echo $ctx->users['album_id'];?>);"><img src="/images/CloseIcon.png" alt="Close" border="0" class="img_inline" title="Delete"/></a></span>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
</tal:block>

